package com.allwees.bs.module.fms.req;

import com.allwees.bs.core.modelbase.branch.BranchUser;
import com.allwees.bs.core.modelbase.branch.EBranchType;
import com.allwees.bs.core.modelbase.req.Req;
import com.allwees.bs.core.modelbase.validate.ValidateItem;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

/**
 * 设置默认提现账户
 *
 * @author yangylsky
 * @since 2020-03-16
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SetDefaultWithdrawReq extends Req {
	private EBranchType branchType;

	private String branchUuid;

	private String withdrawAccountUuid;

	@Override
	public ValidateItem[] getValidateItems() {
			return new ValidateItem[] {
				ValidateItem.of(StringUtils.isBlank(withdrawAccountUuid), "提现账户不能为空")
			};
	}

	@Override
	protected void completion() {
		super.completion();

		BranchUser branchUser = checkBranchUser();
		setBranchType(branchUser.getBranchType());
		setBranchUuid(branchUser.getBranchUuid());
	}
}
